package com.example.aaaaa.ftn1;

import java.util.List;

import com.example.aaaaa.R;
import com.example.aaaaa.Activity.MainActivity;
import com.example.aaaaa.ViewModel.*;

import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Aoivtity2 extends MainActivity {
	private TextView vt3;
	private Button btna;
	int len = 0;
	static String tag = "Aoivtity2";

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		Log.d(tag, "in onCreate of Aoivtity2");

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_aoivtity2);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_aoivtity2, menu);
		return true;
	}

	@Override
	protected void initControlsAndRegEvent() {
		vt3 = (TextView) findViewById(R.id.vt3);
		btna = (Button) findViewById(R.id.btna);

		btna.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {

				toActitity(Aoivtity2.this,Activity1.class);
			}
		});
	}

	@Override
	protected ViewModel initModel() {

		return null;
	}

	@Override
	protected void upDateView(ViewModel aVM) {

		if (aVM != null) {

			String dsptxt = "a" + ((ViewModelY) aVM).getAge2();

			vt3.setText(dsptxt);
		}

	}

	@Override
	protected void processViewModelErrorMsg(List<ModelErrorInfo> errsOfVM,
			String errMsg) {
		// TODO Auto-generated method stub

	}

}
